package com.filetest;

import java.io.*;

public class ZiFu {
    public static void main(String[] args) throws IOException {
        File f = new File("D:/demo3.doc");
        Writer out = new FileWriter(f);

        out.write("你好 world");
        out.write("你好2 world");
        out.write("你好3 world");
        out.close();
        Reader reader = new FileReader(f);
        char c[]=new char[1024];
        int len=reader.read(c);
        System.out.println(new String(c,0,len));
        out.close();
        reader.close();
    }
}
